<?php

namespace Sifast\ProjectBundle\Admin;

use Sonata\AdminBundle\Admin\Admin;
use Sonata\AdminBundle\Datagrid\ListMapper;
use Sonata\AdminBundle\Datagrid\DatagridMapper;
use Sonata\AdminBundle\Form\FormMapper;

class SpecificationPosteAdmin extends Admin
{
 
    protected function configureFormFields(FormMapper $formMapper)
    {
        $formMapper
        ->with('L1')
            ->add('titre','text',array(
                'label'=>'Titre:'
            ))
            ->add('observation','text',array(
                'label'=>'Observation:'
            ))
       ->end()         
       ->with('L2')     
            ->add('categorie','text',array(
                'label'=>'Catégorie:'
            ))
            ->add('dateDebut', 'date', array(
                    'label'=> 'Date de debut:',
                    'widget' => 'single_text',
                    'format' => 'MM/dd/yyyy',
                    'attr' => array('class' => 'datepicker')
                ))
      ->end()
      ->with('L3') 
            ->add('dateFin', 'date', array(
                    'label'=> 'Date de fin:',
                    'widget' => 'single_text',
                    'format' => 'MM/dd/yyyy',
                    'attr' => array('class' => 'datepicker')
                ))
            ->add('unite','text',array(
                'label'=>'Unité:'
            ))
     ->end()
     ->with('L4')           
            ->add('responsable','text',array(
                'label'=>'Responsable:'
            ))
     ->end()           ;
           
            
            
    }

    protected function configureDatagridFilters(DatagridMapper $datagridMapper)
    {
        $datagridMapper
            ->add('titre')
            ->add('observation')
            ->add('categorie')
            ->add('unite') 
            ->add('responsable')
            ->add('dateDebut')
            ->add('dateFin');
            
    }

    protected function configureListFields(ListMapper $listMapper)
    {
        $listMapper
            ->addIdentifier('titre')
            ->add('observation')
            ->add('categorie')
            ->add('unite') 
            ->add('responsable')
            ->add('dateDebut')
            ->add('dateFin');
            
            }
}